import { defineStore } from "pinia";
import { getCitiesAPI } from '@/servieces/index.js';

const useCityStore = defineStore(
  "cityStore",
  {
    state: () => ({
      allCities: {},
      currentCity: { cityName: "广州" }
    }),
    actions: {
      async getAllCities() {
        const res = await getCitiesAPI()
        this.allCities = res.data
      },
    }
  }
)

export default useCityStore